import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'


// 导入echarts
import * as echarts from 'echarts';
Vue.prototype.$echarts = echarts

// 导入element-ui库
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
Vue.use(ElementUI);

// 导入字体图标库
import 'assets/fonts/iconfont.css'
// 导入全局css样式
import 'assets/css/base.css'

// 创建事件总线
Vue.prototype.$bus = new Vue()
// 服务器基础地址
Vue.prototype.baseHttp = "http://39.105.40.148:3001/"

// 导入富文本编辑器
import VueQuillEditor from 'vue-quill-editor'
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'
Vue.use(VueQuillEditor)

//全局过滤器
Vue.filter("dateFormat", (originDate, type) => {
  const date = new Date(originDate)

  const y = date.getFullYear()
  const m = (date.getMonth() + 1 + "").padStart(2, '0')
  const d = (date.getDate() + "").padStart(2, '0')

  const hh = (date.getHours() + "").padStart(2, '0')
  const mm = (date.getMinutes() + "").padStart(2, '0')
  const ss = (date.getSeconds() + "").padStart(2, '0')
  if (!type) return `${y}-${m}-${d} ${hh}:${mm}:${ss}`
  return `${y}-${m}-${d}`

})
Vue.config.productionTip = false


new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')